package com.hang.exception;

public class MyException extends RuntimeException {

	private int code;
    private String msg;


	public MyException(int code, String msg) {
        this.code = code;
        this.msg = msg;
	}

	/**
	 * 指定错误码构造通用异常
	 * @param errorCode 错误码
	 */
	public MyException(final ErrorCode errorCode) {
		super(errorCode.getDescription());
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}	
    
}
